<?php 
namespace EasyRoute;

/**
 *  route driver
 *  @author  leesin <leesin_code@163.com>
 *  @date 2018-08-31
 */
class Route
{
	protected $method;

	protected $regex;

	protected $variables;

	protected $hanlder;

	public function __construct($mehtod, $hanlder, $regex, $variables){
		$this->method = $method;
		$this->hanlder = $hanlder;
		$this->regex = $regex;
		$this->variables = $variables;
	}

	public function matches($str){
		$regex = '~^'.$this->regex.'$~';
		return (bool) preg_match($regex, $str);
	}
}
